<?php
namespace app\erp\controller;

class Sale extends Base
{

    public $post;

    public function _initialize()
    {
        parent::_initialize();
        $request = request();
        $param = $request->param();
        $this->post = $param;
    }

    public function formTpl()
    {
        $this->assign('goods_sign', $this->post['goods_sign']);
        $lay_data = array();
        if (isset($this->post['sale_name'])) {
            $lay_data['sale_name'] = $this->post['sale_name'];
            $lay_data['sale_value'] = str_replace(',', chr(13), $this->post['sale_value']);
            $lay_data['sale_price'] = $this->post['sale_price'];
        }
        $this->assign('data', json_encode($lay_data));
        return $this->fetch();
    }
}